﻿$(document).ready(function () {
    //初始化对象
    var m_cksqdj = new SmObjectData("CKQDJK", "采矿申请登记");
    //获取流程号PROJECT_ID	
    var m_project_id = $.query.get("Project_ID");
    var SLLX = $.query.get("SLLX");
    if (SLLX != "1") {
        $(".m_btn").css("display", "none");
    }
    //获取一条记录
    m_cksqdj.GetFirstSmObject("PROJECT_ID=\\\'" + m_project_id + "\\\'");
    //给申请页面赋值
    $(":text").each(function () {
        var ff = $(this).attr("name");
        $(this).val(m_cksqdj.GetValue(ff));
    });
    //此处保留保存坐标列表信息位置

    //保存申请页面信息
    $("#btnSave").click(function () {
        m_cksqdj.SetValue("PROJECT_ID", m_project_id);
        $(":text").each(function () {
            m_cksqdj.SetValue($(this).attr("name"), $(this).val());
        });
        var res = m_cksqdj.Save(DBCenterServiceUrl + "/KZ_SPDJ/KZ_SPDJ_CKSQDJ.asmx/SaveCKQXL", "'LX':'KQFW'");
        if (res == true) {
            alertex("保存成功", true);
        }
        else alertex("保存失败", true);
    });
});